package edu.yngsxy.wkstudy.core.sys.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.yngsxy.wkstudy.core.model.entity.WkBaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
/**
 * <p>
 * 课程表
 * </p>
 *
 * @author group 2
 * @since 2025-09-09
 */
@Getter
@Setter
@ToString
@TableName("course")
@Accessors(chain = true)
@Schema(description = "课程表")
public class Course extends WkBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 课程ID
     */
    @TableField(value = "course_id")
    @Schema(title = "课程ID", description = "课程ID", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "课程ID不能为空")
    private Integer courseId;

    /**
     * 课程名称
     */
    @TableField("course_name")
    @Schema(title = "课程名称", description = "课程名称", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "课程名称不能为空")
    @Size(max = 200, message = "课程名称长度不能超过200个字符")
    private String courseName;

    /**
     * 课程介绍
     */
    @TableField("introduction")
    @Schema(title = "课程介绍", description = "课程介绍", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    @Size(max = 65535, message = "课程介绍长度不能超过65,535个字符")
    private String introduction;

    /**
     * 封面图路径
     */
    @TableField("cover_image")
    @Schema(title = "封面图路径", description = "封面图路径", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    @Size(max = 200, message = "封面图路径长度不能超过200个字符")
    private String coverImage;

    /**
     * 是否公开（学生可见）
     */
    @TableField("is_public")
    @Schema(title = "是否公开（学生可见）", description = "是否公开（学生可见）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private Boolean isPublic;

    /**
     * 教师ID（外键，关联User）
     */
    @TableField("teacher_id")
    @Schema(title = "教师ID（外键，关联User）", description = "教师ID（外键，关联User）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private Integer teacherId;

    /**
     * 课程分类ID（外键，关联CourseCategory）
     */
    @TableField("category_id")
    @Schema(title = "课程分类ID（外键，关联CourseCategory）", description = "课程分类ID（外键，关联CourseCategory）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private Integer categoryId;
}
